<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 贾振鹏
  Date: 2021/6/2
  Time: 16:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>系统配置列表</title>
    <link rel="stylesheet" href="${css}/pintuer.css">
    <link rel="stylesheet" href="${css}/admin.css">
    <script src="${js}/jquery.js"></script>
    <script src="${js}/pintuer.js"></script>
</head>
<body>
<form method="post" action="${root}/admin/config/list" id="listform">
    <input type="hidden" id="currentPage" name="currentPage" value="${pv.pageIndex}">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
        <table class="table table-hover text-center">
            <tr>
                <th width="100" style="text-align:left; padding-left:20px;">序号</th>
                <th width="10%">配置名称</th>
                <th>配置值</th>
                <th>配置说明</th>
                <th width="10%">更新时间</th>
            </tr>
                <tbody>
                <c:forEach items="${pv.objList}" var="config" varStatus="v">

                <tr>
                    <td style="text-align:left; padding-left:20px;">
                      ${v.count}  </td>
                    <td><a href="${root}/admin/sysconfig/editview?id=${config.id}">${config.configname}</a></td>
                    <td width="10%">${config.configvalue}</td>
                    <td><font color="#00CC99">${config.configdesc}</font></td>
                    <td><fmt:formatDate value="${config.modifydate}" pattern="yyyy-MM-dd HH:mm"/></td>
                </tr>
                </c:forEach>
                </tbody>
                <tr>
                    <td colspan="8">
                        <div class="pagelist">
                            <c:forEach begin="1" end="${pv.pageTotal}" var="i">
                                <c:if test="${pv.pageIndex ne 1}">
                                    <a href="javascript:;" onclick="changePage(1)">第一页</a>
                                    <a href="javascript:;" onclick="changePage(${pv.pageIndex-1})">上一页</a>
                                </c:if>
                                <c:choose>
                                    <c:when test="${pv.pageIndex eq i}">
                                        <span class="current">${i}</span>
                                    </c:when>
                                    <c:otherwise>
                                        <a href="javascript:;" onclick="changePage(${i})">${i}</a>
                                    </c:otherwise>
                                </c:choose>
                                <c:if test="${pv.pageIndex ne pv.pageTotal}">
                                    <a href="javascript:;" onclick="changePage(${pv.pageIndex+1})">下一页</a>
                                    <a href="javascript:;" onclick="changePage(${pv.pageTotal})">尾页</a>
                                </c:if>
                            </c:forEach>
                        </div>
                    </td>
                </tr>
        </table>
    </div>
</form>
<script type="text/javascript">
    $(function () {
        //修改页码
        function changePage(page){
            $("#currentPage").val(page);
            $("#listform").submit();
        }
        
    })



</script>
</body>
</html>
